<td width="727"><table width="727" border="0" cellspacing="0" cellpadding="0">
                                <tr> 
                                  <td width="727" height="47" valign="top" background="img/bar_blue.jpg"><table width="727" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td width="10" height="47">&nbsp;</td>
                                        <td width="23" height="47"><img src="img/bar_flblue.jpg" width="23" height="23"></td>
                                        <td width="10" height="47">&nbsp;</td>
                                        <td height="47" class="tahoma12W"><strong> 
                                          <?php echo $lang['CONTENT_TITLE_REGISTER']; ?></strong></td>
                                      </tr>
                                    </table></td>
                                </tr>
                                <tr> 
                                  <td width="727" height="6" valign="top"><img src="img/spec_blank.gif" width="10" height="7"></td>
                                </tr>
                                <tr> 
                                  <td width="727" height="878" valign="top" bgcolor="#99CC33"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td height="601" valign="top" bgcolor="F1F3EB"><table width="100%" height="878" border="0" cellpadding="0" cellspacing="0">
                                            <tr> 
                                              <td height="763" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr> 
                                                    <td width="10" height="10"></td>
                                                    <td height="10"></td>
                                                    <td width="10" height="10"></td>
                                                  </tr>
                                                  <tr> 
                                                    <td width="10">&nbsp;</td>
                                                    <td align="left" valign="top" class="arial12G66">
															<?php
	
																if(isset($_POST['submit'])){
																	if(empty($_POST['username'])){
																		$errors[] = $lang['ERROR_USERNAME'];
																	}
																	if(empty($_POST['password'])){
																		$errors[] = $lang['ERROR_PASSWORD'];
																	}else{
																		if($_POST['password']!=$_POST['confirmpassword'])
																		{
																			$errors[] = $lang['ERROR_PASSWORD_NOTMATCH'];
																		}
																		
																	}
																	if (valid_email($_POST['email'])==FALSE){
																		$errors[] = $lang['ERROR_EMAIL_NOTVALID'];
																	}
																	if(empty($_POST['name'])){
																		$errors[] = $lang['ERROR_NAME'];
																	}
																	if(empty($_POST['notel'])){
																		$errors[] = $lang['ERROR_PHONE'];
																	}
																	if(is_array($errors)){
																		echo '
																		<table width=500 align=center border=0 cellspacing=0 cellpadding=0>
																		<tr>
																			<td>
																		<div style="margin-bottom:10px;font-family: tahoma; font-size: 11px;">';
																		echo '<p style="padding:0px; margin:0px; color:red;"><b>'.$lang['CONTENT_ERROR_OCCUR'].'</b></p>';
																		while (list($key,$value) = each($errors))
																		{
																			echo '<span style="padding:10px;color:red;">'.$value.'</span><br />';
																		}
																		echo '</div> </td></tr></table>';
																	}else{
																		
																		$username = mysql_real_escape_string($_POST['username']); 
																		$no_ahli = mysql_real_escape_string($_POST['no_ahli']); 
																		$email = mysql_real_escape_string($_POST['email']); 
																		$password = mysql_real_escape_string($_POST['password']); 
																		$name = mysql_real_escape_string($_POST['name']); 
																		$phoneNo = mysql_real_escape_string($_POST['notel']); 
																		
																		$Qusername = "SELECT * from user where username = '$username'";
																		$Tusername = $db->sql_total($Qusername);	
																	
																		$Qemail = "SELECT * from user where email = '$email'";
																		$Temail = $db->sql_total($Qemail);	
																		
																		$verify_ahli = "";
																		if($no_ahli != ""){
																			$verify_ahli = "Wait Approval";
																		}
																		
																		if($Tusername <> 0){
																			echo'
																						<table width=500 align=center border=0 cellspacing=0 cellpadding=0>
																							
																							<tr>
																								<td><h4 style="font-size:12px;color:red;">
																										'.$lang['ERROR_USERNAME_NOTAVAILABLE'].'</h4>
																								</td>
																							</tr>
																						</table>
																						
																						';
																		}
																		if($Temail <> 0){
																			echo'
																						<table width=500 align=center border=0 cellspacing=0 cellpadding=0>
																							
																							<tr>
																								<td><h4 style="font-size:12px;color:red;">
																										'.$lang['ERROR_EMAIL_NOTAVAILABLE'].'</h4>
																								</td>
																							</tr>
																						</table>
																						
																						';
																		}
																		
																		if($Temail==0 && $Tusername==0){
																			$activatedTemp=strtoupper(Random2(15,1));
																			$activatedkey = md5($username.$activatedTemp).strtotime ("+0 day"); 
																			$createUser= "INSERT INTO user(username, password, email, name, notel,no_ahli,activatedkey,status,verify_ahli, created_date) VALUES 
																			('$username',PASSWORD('$password'), '$email','$name', '$phoneNo','$no_ahli','$activatedkey','not verify','$verify_ahli', NOW())";
																			$result = $db->sql_query($createUser);
																			
																			$domainFullWebUrl = domainFullWebUrl();
																			if ($result){	
																				
																				include ('phpmailer/class.phpmailer.php');
																				include ('phpmailer/class.smtp.php');
																				include ('phpmailer/phpmailer.lang-en.php');

																				date_default_timezone_set('Asia/Singapore');
																				$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
																				$mail->IsSMTP(); // telling the class to use SMTP
																				try{
																					$mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
																					$mail->SMTPAuth   = true;                  // enable SMTP authentication
																					//$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
																					//$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
																					//$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
																					//$mail->Username   = "kppptnb@gmail.com";  // GMAIL username
																					//$mail->Password   = "asdfg123";            // GMAIL password
																					
																					$mail->Host       = "mail.powergoat2u.com.my";      // sets GMAIL as the SMTP server
																					$mail->Port       = 25;                   // set the SMTP port for the GMAIL server
																					$mail->Username   = "powergoa";  // GMAIL username
																					$mail->Password   = "8RU5EmGs";            // GMAIL password
																	  
																					$mail->SetFrom(INFOEMAIL, EMAILNAME);
																					$mail->AddAddress("$email", "$username");

																					$mail->Subject    = $lang['CONTENT_EMAIL_SUBJECT'];

																					$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
																					$mail->Body ="
																									<html>
																									<body>
																									<table width=500 cellpadding=3>
																										<tr>
																											<td>
																												".$lang['CONTENT_EMAIL_DEAR']." ".$username.",
																											</td>
																										</tr>
																										<tr>
																											<td>
																												<br>
																												".$lang['CONTENT_EMAIL_KNWLEDGE']."
																											</td>
																										</tr>
																										<tr>
																											<td>
																												<br>
																												".$lang['CONTENT_EMAIL_VERIFY_INFO']."
																											</td>
																										</tr>
																										<tr>
																											<td>
																												<br>
																												<a style='font-size:13px; font-weight:bold;' href='".$domainFullWebUrl."verifyemail.php?active=".$activatedkey."'>".$lang['CONTENT_EMAIL_VERIFY']."<a>
																											</td>
																										</tr>
																										<tr>
																											<td>
																												<br>
																												".$lang['CONTENT_EMAIL_LOGIN']."  ".$username."
																											</td>
																										</tr>
																										<tr>
																											<td>
																												<br>
																												".$lang['CONTENT_EMAIL_PASSWORD']."  ".$password."
																											</td>
																										</tr>
																										<tr>
																											<td>
																												<br>
																												".$lang['CONTENT_EMAIL_REMEMBER']."
																											</td>
																										</tr>
																										
																										<tr>
																											<td>
																												<br>
																												".$lang['CONTENT_EMAIL_PROBLEMS']."
																												<a style='font-size:11px; font-weight:bold;' href='".$domainFullWebUrl."contactus.php'>".$lang['CONTENT_EMAIL_CONTACTUS']."<a>
																											</td>
																										</tr>
																									<table>
																									</body>
																									</html>";
																					//$mail->AddAttachment("images/phpmailer.gif");             // attachment
																					$mail->Send();
																				} catch (phpmailerException $e) {
																					echo"
																					<table width=500 align=center border=0 cellspacing=0 cellpadding=0>
																						<tr><td><div style='font-weight:bold; font-size:14px; font-family:tahoma;'>
																								".$e->errorMessage()." </div>
																							</td></tr>
																						<tr><td height=15></td></tr>
																					</table>";
																				  //echo $e->errorMessage(); //Pretty error messages from PHPMailer
																				} catch (Exception $e) {
																					echo"
																					<table width=500 align=center border=0 cellspacing=0 cellpadding=0>
																						<tr><td><div style='font-weight:bold; font-size:14px; font-family:tahoma;'>
																								".$e->errorMessage()." </div>
																							</td></tr>
																						<tr><td height=15></td></tr>
																					</table>";
																				}
																				
																				//	Display success																			
																				echo'
																					<table width=500 align=center border=0 cellspacing=0 cellpadding=0>
																						<tr>
																							<td><div style="font-weight:bold; font-size:14px; font-family:tahoma;">'.$lang['CONTENT_REGISTER_SUCCESS'].' </div>
																							</td>
																						</tr>
																						<tr>
																							<td><div style="font-weight:bold;font-size:11px; font-family:tahoma;">
																									'.$lang['CONTENT_THANKS'].'
																									<br /> 
																									'.$lang['CONTENT_SENDMAIL_INFO_VERIFY'].'
																									'.$lang['CONTENT_MAY_LOGIN'].'</div>
																							</td>
																						</tr>
																						<tr>
																							<td height=15>
																							</td>
																						</tr>
																					</table>
																					
																					';
																			}
																		}
																		
																	}
																
																}
															
															?>
															
															<form action="" method="POST">	
																<table width="500" align="center" border="0" cellspacing="0" cellpadding="0">
																	<tr>
																		<td width="20%" class="tahoma11G"><?php echo $lang['FORM_USERNAME']; ?></td>
																		<td width="1%"> : </td>
																		<td class="tahoma11G"><input type="text" title="<?php echo $lang['CONTENT_DESC_USERNAME'] ?>" name="username" 
																			value="<?php if($_POST['username']!= null) { echo $_POST['username'];} ?>" size="35" ></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td width="30%" class="tahoma11G"><?php echo $lang['FORM_PASSWORD']; ?></td>
																		<td width="5%"> : </td>
																		<td class="tahoma11G"><input type="password" name="password" value="" size="35" ></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td width="30%" class="tahoma11G"><?php echo $lang['FORM_PASSWORD_REPEAT']; ?></td>
																		<td width="5%"> : </td>
																		<td class="tahoma11G"><input type="password" name="confirmpassword" value="" size="35" ></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td width="30%" class="tahoma11G"><?php echo $lang['FORM_EMAIL']; ?></td>
																		<td width="5%"> : </td>
																		<td class="tahoma11G"><input type="text" name="email" title="<?php echo $lang['CONTENT_DESC_EMAIL'] ?>"
																			value="<?php if($_POST['email']!= null) { echo $_POST['email'];} ?>" size="35" ></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td width="30%" class="tahoma11G"><?php echo $lang['FORM_NAME']; ?></td>
																		<td width="5%"> : </td>
																		<td class="tahoma11G"><input type="text" name="name" 
																			value="<?php if($_POST['name']!= null) { echo $_POST['name'];} ?>" size="35" ></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td width="30%" class="tahoma11G"><?php echo $lang['FORM_NO_AHLI'] ?></td>
																		<td width="5%"> : </td>
																		<td class="tahoma11G">
																			<input type="text" title="<?php echo $lang['CONTENT_DESC_KEAHLIAN'] ?>" name="no_ahli" style="float: left; display:inline; "
																				value="<?php if($_POST['no_ahli']!= null) { echo $_POST['no_ahli'];} ?>" size="35"  >
																			
																		<span  title="<?php echo $lang['CONTENT_DESC_KEAHLIAN'] ?>">
																			<img style=" float: right;padding-right: 55px;" src="img/info_icon.gif" height="20" width="20">
																		</span>
																		</td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td width="30%" class="tahoma11G"><?php echo $lang['FORM_PHONE']; ?></td>
																		<td width="5%"> : </td>
																		<td class="tahoma11G"><input type="text" name="notel" 
																			value="<?php if($_POST['notel']!= null) { echo $_POST['notel'];} ?>" size="35" ></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td colspan="3" class="tahoma11G">
																			<button name="submit" type="submit" style="border: 0; background: transparent;float:right; margin-right:80px;
																				cursor:pointer;">
																			    <img src="img/btn_register.jpg" width="59" height="20"  alt="submit" />
																			</button>
																		</td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px"></td>
																	</tr>
																	<tr>
																		<td colspan="3" style="height:5px;font-size:14px;font-weight:bold;" 
																			class="tahoma11G" >
																				Nota : </td>
																	</tr>
																	<tr>
																		<td colspan="3" class="tahoma11G" style="height:5px;font-size:11px;font-weight:bold;">
																			<?php echo $lang['CONTENT_NOTE_KEAHLIAN'] ?></td>
																	</tr>
																	
																</table>
															</form>
															
															
                                                    </td>
                                                    <td width="10">&nbsp;</td>
                                                  </tr>
                                                  <tr> 
												  
                                                    <td width="10" height="10"></td>
                                                    <td height="10"></td>
                                                    <td width="10" height="10"></td>
                                                  </tr>
                                                </table></td>
												
                                            </tr>
                                            <tr> 
                                              <td height="115" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr valign="top"> 
                                                    <td width="115" height="115"><img src="img/spec_ornamentLeft.jpg" width="115" height="115"></td>
                                                    <td height="115">&nbsp;</td>
                                                    <td width="115" height="115"><img src="img/spec_ornamentRight.jpg" width="115" height="115"></td>
                                                  </tr>
                                                </table></td>
												
                                            </tr>
                                          </table></td>
                                      </tr>
                                    </table></td>
                                </tr>
                              </table>